/*
DirBkgndExt.
Copyright (C) 2007 sevenever  

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
// FileContextMenuExt.h : Declaration of the CFileContextMenuExt

#ifndef __FILECONTEXTMENUEXT_H_
#define __FILECONTEXTMENUEXT_H_

#include "resource.h"       // main symbols
#include "shlobj.h"
#include "comdef.h"

/////////////////////////////////////////////////////////////////////////////
// CFileContextMenuExt
class ATL_NO_VTABLE CFileContextMenuExt : 
	public IShellExtInit,		
	public IContextMenu,
	public CComObjectRootEx<CComSingleThreadModel>,
	public CComCoClass<CFileContextMenuExt, &CLSID_FileContextMenuExt>,
	public IDispatchImpl<IFileContextMenuExt, &IID_IFileContextMenuExt, &LIBID_DIRBKGNDEXTLib>
{
public:
	CFileContextMenuExt()
	{
	}

DECLARE_REGISTRY_RESOURCEID(IDR_FILECONTEXTMENUEXT)

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CFileContextMenuExt)
	COM_INTERFACE_ENTRY(IFileContextMenuExt)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(IShellExtInit) 	
	COM_INTERFACE_ENTRY(IContextMenu) 
END_COM_MAP()

protected:
TCHAR m_szFile [MAX_PATH];
int offsetMap[8];
// IFileContextMenuExt
public:
// IShellExtInit
STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
// IContextMenu
STDMETHOD(GetCommandString)(UINT, UINT, UINT*, LPSTR, UINT);
STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO);
STDMETHOD(QueryContextMenu)(HMENU, UINT, UINT, UINT, UINT);
};

#endif //__FILECONTEXTMENUEXT_H_
